$(document).ready(function() {
	var rpath = getRootPath();
	$('#class1').change(function() {
		var timestamp = (new Date()).valueOf(); 
		$.getJSON(rpath+ "/admin/business/getClassTA/"+timestamp, {
			id : $('#class1').val()
		}, function(data) {
			$('#class2').empty();
			if(data['ret']==1){
				for(var tmp in data['class2List']){
					$('#class2').append($('<option></option>').text(data['class2List'][tmp]['name']).val(data['class2List'][tmp]['id']));
				}
			}else
				$('#class2').append($('<option></option>').text("无").val(0));
		});
	});
	
	$('#region').change(function() {
		var timestamp = (new Date()).valueOf(); 
		$.getJSON(rpath+ "/admin/business/getAreaTA/"+timestamp, {
			id : $('#region').val()
		}, function(data) {
			$('#area').empty();
			if(data['ret']==1){
				for(var tmp in data['areaList']){
					$('#area').append($('<option></option>').text(data['areaList'][tmp]['name']).val(data['areaList'][tmp]['id']));
				}
			}else $('#area').append($('<option></option>').text("无").val(0));
		});
	});
	
});